// const defaultState = {
//     newsLists: {},
//     page: 1,
//     message: ''
// }

// function news(state = defaultState, action) {
//     switch (action.type) {
//         case 'ADD':
//             return;
//         case 'GETNEWSLISTS':
//             return Object.assign({}, state, { newsLists: action.data, page: action.data.page });
//         case 'DELETE_LISTS_DATA':
//             console.log(action.data)
//             return Object.assign({}, state, { message: action.data.message });
//         default:
//             return state;

//     }
// }

// module.exports = news;
const defaultState={
    newsLists:{},
    page:1,
    message:'',
    id:0,
   }
   
   function news(state=defaultState,action){
       console.log('reduce123',action.data);
       switch(action.type){
           case 'ADD':
               return  ;
           case 'GETNEWSLISTS':
           return  Object.assign({},state,{newsLists:action.data,page:action.data.page});
           case 'DELETE_LISTS_DATA':
           return Object.assign({},state,{message:action.data.message});
           case 'TRY':
           return Object.assign({},state,{id:action.data});
           default:
               return state;
           
       }
   }
   
   module.exports=news;
